///*
// * Copyright (C) 2004, Velocityme Partnership
// * ContactDetailTypeActions.java
// *
// * Created on 16 October 2004, 10:14
// */
//
//package com.velocityme.www.interfaces.nodeactions;
//
//import com.velocityme.interfaces.*;
//import com.velocityme.valueobjects.ContactDetailTypeValue;
//import com.velocityme.www.actionforms.ContactDetailTypeActionForm;
//import com.velocityme.www.utility.NodeUtil;
//import java.util.*;
//import javax.servlet.http.*;
//import org.apache.struts.action.*;
//
///**
// *
// * @author  Robert
// */
//public class ContactDetailTypeActions extends NodeActions {
//
//    /** Creates a new instance of ContactDetailTypeActions */
//    public ContactDetailTypeActions() {
//    }
//
//    public ActionForward showNode(ActionMapping mapping,
//                                  ActionForm form,
//                                  HttpServletRequest request,
//                                  HttpServletResponse response) throws Exception {
//        HttpSession session = request.getSession();
//        KeySession key = (KeySession)session.getAttribute("sessionKey");
//        RemoteClientSession cs = RemoteClientSessionUtil.getHome().create();
//        session.setAttribute("contactDetailTypeValues", cs.getAllContactDetailValues(key));
//        return mapping.findForward("ACTION_DISPLAY");
//    }
//
//    public ActionForward showEdit(ActionMapping mapping,
//                                  ActionForm form,
//                                  HttpServletRequest request,
//                                  HttpServletResponse response) throws Exception {
//        HttpSession session = request.getSession();
//        KeySession key = (KeySession)session.getAttribute("sessionKey");
//        RemoteClientSession cs = RemoteClientSessionUtil.getHome().create();
//        ContactDetailTypeActionForm actionForm = (ContactDetailTypeActionForm)form;
//        actionForm.setCmd(0,"");
//        actionForm.setContactDetailTypeValues(cs.getAllContactDetailValues(key));
//        session.setAttribute("notificationPairs", NodeUtil.getAllNotificationPairs(key, cs));
//        return mapping.findForward("ACTION_EDIT");
//    }
//
//    public ActionForward edit(ActionMapping mapping,
//                              ActionForm form,
//                              HttpServletRequest request,
//                              HttpServletResponse response) throws Exception {
//        HttpSession session = request.getSession();
//        KeySession key = (KeySession)session.getAttribute("sessionKey");
//        RemoteClientSession cs = RemoteClientSessionUtil.getHome().create();
//        ContactDetailTypeActionForm actionForm = (ContactDetailTypeActionForm)form;
//        if (actionForm.processCmd()) {
//            actionForm.setCmd(0,"");
//            return mapping.findForward("ACTION_EDIT");
//        }
//        if (request.getParameter("btnSubmit").equals("OK")) {
//            cs.setContactDetailTypeValues(key, actionForm.getContactDetailTypeValues(cs.getAllNotificationMechanismValues(key)));
//        }
//        NodePK nodePK = new NodePK((Integer)session.getAttribute("nodeId"));
//        request.setAttribute("nodePK", nodePK);
//        return mapping.findForward("ACTION_SUCCESS");
//    }
//
//}
